package 设计模式.flyweight;

public class Client {
    public static void main(String[] args) {
        WebSiteFactory factory=new WebSiteFactory();
        WebSite we1 = factory.getWebSiteFactory("新闻");
        we1.use(new User("张三"));

        WebSite we2 = factory.getWebSiteFactory("博客");
        we2.use(new User("李三"));
        WebSite we3 = factory.getWebSiteFactory("博客");
        we3.use(new User("张三"));
        WebSite we4 = factory.getWebSiteFactory("博客");
        we4.use(new User("王三"));
        System.out.println("几个分类"+factory.getWebSiteCount());
    }
}
